import * as API from '../axios';

export default {
  //网点-获取列表
  branchlist: (url, params) => {
    return API.axiosGetAPI(url, params);
  },
  //调整金额
  adjustMoney: params => {
    const headers = {
      'lang-key': 'agency_Adjust_balance'
    }
    return API.axiosPATCHAPI('/manage/branches/amount', params, headers);
  },
  //网点图片审核
  audit: (url) => {
    return API.axiosPutAPI(url);
  },
  //修改状态
  alterthestate: (params) => {
    const headers = {
      'lang-key': params.state == 1 ? 'branch_resumePartnership' : 'branch_Terminate'
    }
    return API.axiosPutAPI('/manage/branches/state', params, headers);
  },
  //商家列表
  merchantlist: (params) => {
    return API.axiosGetAPI('/manage/merchants/box', params);
  },
  //所有的机柜
  jiguilist: params => {
    return API.axiosGetAPI('/manage/cabinets/box', params);
  },
  //所有的机柜
  jiguilists: (type, cabinetType) => {
    return API.axiosGetAPI(`/manage/cabinets/box?type=${type}&cabinetType=${cabinetType}`);
  },
  //所有计费规则
  jifeiguizelist: params => {
    return API.axiosGetAPI('/manage/billings/all', params);
  },
  //新增店铺
  addbranch: params => {
    const headers = {
      'lang-key': 'branch_Create'
    }
    return API.axiosPostAPI('/manage/branches', params, headers);
  },
  //所有代理
  agentsList: params => {
    return API.axiosGetAPI('/manage/agents/box', params);
  },
  //网点详情
  addxiangqin: params => {
    return API.axiosGetAPI(params);
  },
  //所有的机柜
  wdjiguilist: (url, params) => {
    return API.axiosGetAPI(url, params);
  },
  //网点订单
  Networkorder: (url, params) => {
    return API.axiosGetAPI(url, params);
  },
  //获取用户账单流水集合
  Watercollection: (url, params) => {
    return API.axiosGetAPI(url, params);
  },
  theorderratio: (url) => {
    return API.axiosGetAPI(url);
  },
  servicetime: (url, params) => {
    return API.axiosGetAPI(url, params);
  },
  //今日新增
  addlist: (params) => {
    // return API.axiosGetAPI('/manage/home/all-user',params);
  },
  //编辑网点
  Editnode: (params) => {
    const headers = {
      'lang-key': 'branch_Edit'
    }
    return API.axiosPutAPI('/manage/branches', params, headers);
  },



  //邀请店主
  inviteShopkeeper: (id) => {
    const headers = {
      'lang-key': 'Invite_merchant_owner'
    }
    return API.axiosPostAPI(`manage/branches/${id}/owner/invite-link`,'',headers);
  },

  //邀请店主-邮件
  inviteShopemail: (id, params) => {
    const headers = {
      'lang-key': 'Invite_merchant_owner'
    }
    return API.axiosPostAPI(`/manage/branches/${id}/owner/email-invitation`, params,headers);
  },

  //解绑店主
  unbindShopkeeper: (id) => {
    const headers = {
      'lang-key': 'Remove'
    }
    return API.axiosDeleteAPI(`/manage/branches/${id}/owner`,'',headers);
  },

  //编辑运营状态
  editOperationState: (id) => {
    const headers = {
      'lang-key': 'Start_operations'
    }
    return API.axiosPutAPI(`/manage/branches/${id}/operation-state`,'',headers);
  },
};